package com.example.demo.pojo;


import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 数据库字段信息
 */
public class UserInfo implements Serializable {

    private static final long serialVersionUID = 3942531219439228596L;
    // 用户ID
    private Integer id;

    // 用户密码
    @NotNull(message = "密码不能为空")
    @Pattern(regexp = "^[0-9A-Za-z_]{4,20}", message = "密码格式错误")
    private String passWord;

    // 用户昵称
    @Pattern(regexp = "^[0-9A-Za-z_]{4,20}", message = "用户昵称格式错误")
    private String userName;

    // 用户手机号
    @Pattern(regexp = "1[3456789]\\d{9}", message = "手机号格式错误")
    @NotNull(message = "手机号不能为空")
    private String mobile;

    // 用户性别
    private String sex;

    // 爱好
    private String hobby;

    // 所在地区
    private String location;

    // 个人描述
    @Pattern(regexp = ".{1,100}", message = "个人描述长度过长/短")
    private String describe;

    // 创建时间
    private String createTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName.trim();
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile.trim();
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex.trim();
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby.trim();
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location.trim();
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe.trim();
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord.trim();
    }

    @Override
    public String toString() {
        return "UserInfoModel{" +
                "id=" + id +
                ", passWord='" + passWord + '\'' +
                ", userName='" + userName + '\'' +
                ", mobile='" + mobile + '\'' +
                ", sex='" + sex + '\'' +
                ", hobby='" + hobby + '\'' +
                ", location='" + location + '\'' +
                ", describe='" + describe + '\'' +
                ", createTime='" + createTime + '\'' +
                '}';
    }
}
